Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use backstage fetch api instead of the default fetch for node js #180

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

gomezcapg
Copy link
Contributor

@gomezcapg gomezcapg commented Aug 9, 2023

Context

Backstage provides a FetchApi to make requests this allows backstage users to create fetch customizations like automatic header
injections. This Pr modifies the announcements plugin to use the backstage fetch api, making it compatible with any backstage implementation using any fetch api customization.

Changes

  • Loads the fetch api when creating the api factory for the announcements api
  • Uses the fetch api in the default fetch api implementation

Additional Comments

The request object was removed as it was causing problems with the fetch api from backstage, the parameters were passed directly to the fetch call instead

const request = new Request(`${baseApiUrl}${input}`, {
      ...init,
      headers,
    });

Reference

Fetch Api Reference: https://backstage.io/docs/reference/core-plugin-api.fetchapi/

@cursedcoder
Copy link

hi @K-Phoen can you look into this?

@kurtaking
Copy link

@gomezcapg, I'd appreciate it if you opened this against this version. Otherwise, I will do it later this weekend.

@K-Phoen K-Phoen merged commit cd551f5 into K-Phoen:main Dec 27, 2023
2 checks passed
@K-Phoen
Copy link
Owner

K-Phoen commented Dec 27, 2023

Merged, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants